-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: least priv rbac creation #324
Conversation
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
✅ Deploy Preview for pepr-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
## Description Port over existing repo docs to the Hugo site. AC: Ensure that all content is accurately and completely transferred, maintaining its original meaning and structure. The documentation should be consistently formatted, adhering to the Hugo site’s style guidelines, with all links, images, and code snippets functioning correctly. Additionally, the documentation must be easily navigable, responsive across various devices, and fully compatible with different browsers, ensuring a seamless user experience. Will need to update [`README.md`](https://github.com/defenseunicorns/pepr/blob/b6aadddc570fb5ac63e3c98a72eb81b0bf98b078/README.md?plain=1#L3) when site goes live ## Related Issue Fixes #332 <!-- or --> Relates to #324 (If any docs change, they need to change here) ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Other (security config, docs update, etc) ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/pepr/blob/main/CONTRIBUTING.md#submitting-a-pull-request) followed --------- Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
src/lib/assets/index.ts
Outdated
@@ -40,8 +40,8 @@ export class Assets { | |||
|
|||
zarfYaml = (path: string) => zarfYaml(this, path); | |||
|
|||
allYaml = async () => { | |||
allYaml = async (rbacMode: string = "") => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I remember us talking about how the only two acceptable rbacMode values would be admin
or scoped
-- it's what we're enforcing in the cli cmds, right? And, since we've decided that the default-right-now behavior would be considered admin
, I wonder what the utility of setting a default value of empty string here would be? As is, this implies that empty string is a valid value but is it?
I would sort have expected this to have a default value of "admin" (if we wanted to push the validation into the lib code) or to not have a default at all (if we wanted to just rely on the cli invocation).
src/lib/assets/yaml.ts
Outdated
@@ -40,7 +40,7 @@ export function zarfYaml({ name, image, config }: Assets, path: string) { | |||
return dumpYaml(zarfCfg, { noRefs: true }); | |||
} | |||
|
|||
export async function allYaml(assets: Assets) { | |||
export async function allYaml(assets: Assets, rbacMode: string = "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to question in src/lib/assets/index.ts, what's the purpose of a default empty string for rbacMode here? Seems a non-default-valued param would be better here because it wouldn't imply that "" was an expected value. 🤔
Signed-off-by: Case Wylie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Build time flag
--rbac-mode
determines whether whether theClusterRole
for the PeprServiceAccount
receives cluster-admin permissions (default) or scoped permissions based on the capability bindings.Uses a reduce function to iterate over the capability's bindings and determine the
verbs
,plural
, andgroups
needed in order to build aClusterRoleBinding
. That function is used in thecreateClusterRole
function.Includes:
Related Issue
Fixes #31
Relates to #
Type of change
Checklist before merging